import { request } from '../utils/request';
import { apiVirtualSuccessAccess, useVirtualAccess } from '../utils/tools';

export async function queryListData(params) {
  if (useVirtualAccess()) {
    const result = await apiVirtualSuccessAccess({
      pagesize: 10,
      total: 645,
      nowpageindex: 1,
      data: [
        {
          rowId: 1,
          intcityid: 152,
          serialNumber: '154254',
          intorderid: 33,
          contact: '一心只为一人/高茹',
          consumerType: 1,
          payType: 1,
          status: 2,
          amount: 120,
          createTime: '2018-08-04T14:32:15',
          orderType: 1,
          sellerName: '张三',
        },
        {
          rowId: 2,
          intcityid: 152,
          serialNumber: '154214',
          intorderid: 34,
          contact: '秦@娟/秦焕娟',
          consumerType: 2,
          payType: 2,
          status: 2,
          amount: 80,
          createTime: '2018-08-05T14:32:15',
          orderType: 2,
          sellerName: '李四',
        },
        {
          rowId: 2,
          intcityid: 152,
          serialNumber: '154214',
          intorderid: 34,
          contact: '秦@娟/秦焕娟',
          consumerType: 2,
          payType: 2,
          status: 2,
          amount: 80,
          createTime: '2018-08-05T14:32:15',
          orderType: 2,
          sellerName: '李四',
        },
        {
          rowId: 2,
          intcityid: 152,
          serialNumber: '154214',
          intorderid: 34,
          contact: '秦@娟/秦焕娟',
          consumerType: 2,
          payType: 2,
          status: 2,
          amount: 80,
          createTime: '2018-08-05T14:32:15',
          orderType: 2,
          sellerName: '李四',
        },
        {
          rowId: 2,
          intcityid: 152,
          serialNumber: '154214',
          intorderid: 34,
          contact: '秦@娟/秦焕娟',
          consumerType: 2,
          payType: 2,
          status: 2,
          amount: 80,
          createTime: '2018-08-05T14:32:15',
          orderType: 2,
          sellerName: '李四',
        },
        {
          rowId: 2,
          intcityid: 152,
          serialNumber: '154214',
          intorderid: 34,
          contact: '秦@娟/秦焕娟',
          consumerType: 2,
          payType: 2,
          status: 2,
          amount: 80,
          createTime: '2018-08-05T14:32:15',
          orderType: 2,
          sellerName: '李四',
        },
        {
          rowId: 2,
          intcityid: 152,
          serialNumber: '154214',
          intorderid: 34,
          contact: '秦@娟/秦焕娟',
          consumerType: 2,
          payType: 2,
          status: 2,
          amount: 80,
          createTime: '2018-08-05T14:32:15',
          orderType: 2,
          sellerName: '李四',
        },
        {
          rowId: 2,
          intcityid: 152,
          serialNumber: '154214',
          intorderid: 34,
          contact: '秦@娟/秦焕娟',
          consumerType: 2,
          payType: 2,
          status: 2,
          amount: 80,
          createTime: '2018-08-05T14:32:15',
          orderType: 2,
          sellerName: '李四',
        },
      ],
    });

    return result;
  }

  return request('/api/ProductOrder/List', {
    method: 'POST',
    body: params,
  });
}

export async function queryGetData(params) {
  if (useVirtualAccess()) {
    const result = await apiVirtualSuccessAccess({
      data: {
        serialNumber: '154254',
        amount: 6.9,
        remark: '孜然味的',
        monexpressprice: 0.0,
        createTime: '2018-08-04T14:32:15',
        intstate: 1,
        warehouseAddress: '郑州市金水区丰庆路与博卉路交叉口向东300米路南',
        auditor: '丽丽',
        deliveryman: '秦焕娟',
        deliveryDescription: '由秦焕娟站长配送',
        receiveTime: '2018-11-02 16:40:12',
        contact: '一心只为一人/高茹',
        taxes: 0.1,
        refund: 0,
        refundReason: '',
        purseBalance: 12,
        purseScore: 3,
        address: '秦焕娟  |  13937188783  |  河南 - 郑州- 二七区 郑飞小区109号楼302',
        intpaytype: 1,
        list: [
          {
            rowId: 1,
            intcityid: 152,
            serialNumber: '154254',
            intorderid: 33,
            contact: '一心只为一人/高茹',
            consumerType: 1,
            payType: 1,
            status: 2,
            amount: 6.9,
            createTime: '2018-08-04T14:32:15',
            orderType: 1,
            sellerName: '张三',
            productName: '伊赛牛肉块',
            chvspec: '0.8斤x2包',
            intunit: 1,
            monsaleprice: 6.9,
            monexpressprice: 0.0,
            count: 1,
            score: 1,
            remark: '孜然味的',
            warehouseAddress: '郑州市金水区丰庆路与博卉路交叉口向东300米路南',
            auditor: '丽丽',
            deliveryman: '秦焕娟',
            deliveryDescription: '由秦焕娟站长配送',
            receiveTime: '2018-11-02 16:40:12',
            intstate: 1,
            intpaytype: 2,
            totalProductAmount: 6.9,
            taxes: 0.1,
            refund: 0,
            refundReason: '',
            purseBalance: 12,
            purseScore: 3,
            address: '秦焕娟  |  13937188783  |  河南 - 郑州- 二七区 郑飞小区109号楼302',
          },
          {
            rowId: 1,
            intcityid: 152,
            serialNumber: '154254',
            intorderid: 33,
            contact: '一心只为一人/高茹',
            consumerType: 1,
            payType: 1,
            status: 2,
            amount: 6.9,
            createTime: '2018-08-04T14:32:15',
            orderType: 1,
            sellerName: '张三',
            productName: '伊赛牛肉块',
            chvspec: '0.8斤x2包',
            intunit: 1,
            monsaleprice: 6.9,
            monexpressprice: 0.0,
            count: 1,
            score: 1,
            remark: '孜然味的',
            warehouseAddress: '郑州市金水区丰庆路与博卉路交叉口向东300米路南',
            auditor: '丽丽',
            deliveryman: '秦焕娟',
            deliveryDescription: '由秦焕娟站长配送',
            receiveTime: '2018-11-02 16:40:12',
            intstate: 1,
            intpaytype: 2,
            totalProductAmount: 6.9,
            taxes: 0.1,
            refund: 0,
            refundReason: '',
            purseBalance: 12,
            purseScore: 3,
            address: '秦焕娟  |  13937188783  |  河南 - 郑州- 二七区 郑飞小区109号楼302',
          },
          {
            rowId: 1,
            intcityid: 152,
            serialNumber: '154254',
            intorderid: 33,
            contact: '一心只为一人/高茹',
            consumerType: 1,
            payType: 1,
            status: 2,
            amount: 6.9,
            createTime: '2018-08-04T14:32:15',
            orderType: 1,
            sellerName: '张三',
            productName: '伊赛牛肉块',
            chvspec: '0.8斤x2包',
            intunit: 1,
            monsaleprice: 6.9,
            monexpressprice: 0.0,
            count: 1,
            score: 1,
            remark: '孜然味的',
            warehouseAddress: '郑州市金水区丰庆路与博卉路交叉口向东300米路南',
            auditor: '丽丽',
            deliveryman: '秦焕娟',
            deliveryDescription: '由秦焕娟站长配送',
            receiveTime: '2018-11-02 16:40:12',
            intstate: 1,
            intpaytype: 2,
            totalProductAmount: 6.9,
            taxes: 0.1,
            refund: 0,
            refundReason: '',
            purseBalance: 12,
            purseScore: 3,
            address: '秦焕娟  |  13937188783  |  河南 - 郑州- 二七区 郑飞小区109号楼302',
          },
          {
            rowId: 1,
            intcityid: 152,
            serialNumber: '154254',
            intorderid: 33,
            contact: '一心只为一人/高茹',
            consumerType: 1,
            payType: 1,
            status: 2,
            amount: 6.9,
            createTime: '2018-08-04T14:32:15',
            orderType: 1,
            sellerName: '张三',
            productName: '伊赛牛肉块',
            chvspec: '0.8斤x2包',
            intunit: 1,
            monsaleprice: 6.9,
            monexpressprice: 0.0,
            count: 1,
            score: 1,
            remark: '孜然味的',
            warehouseAddress: '郑州市金水区丰庆路与博卉路交叉口向东300米路南',
            auditor: '丽丽',
            deliveryman: '秦焕娟',
            deliveryDescription: '由秦焕娟站长配送',
            receiveTime: '2018-11-02 16:40:12',
            intstate: 1,
            intpaytype: 2,
            totalProductAmount: 6.9,
            taxes: 0.1,
            refund: 0,
            refundReason: '',
            purseBalance: 12,
            purseScore: 3,
            address: '秦焕娟  |  13937188783  |  河南 - 郑州- 二七区 郑飞小区109号楼302',
          },
        ],
      },
    });

    return result;
  }

  return request('/api/ProductOrder/Get', {
    method: 'POST',
    body: params,
  });
}

export async function sendOrderData(params) {
  return request('/api/ProductOrder/UpdateLogistics', {
    method: 'POST',
    body: params,
  });
}

/**
 * 占位函数
 *
 * @export
 * @returns
 */
export async function empty() {
  return {};
}
